home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Palettes / OOPSPalette / OOPSObjectView.m < prev    next >
Text File  |  1995-06-12  |  839b  |  49 lines

  1.  
  2. #import "OOPSObjectView.h"
  3.  
  4. @implementation OOPSObjectView
  5.  
  6. - initFrame:(NXRect *)frameRect
  7. {
  8.      char        buf[MAXPATHLEN + 1];
  9.     NXBundle   *bundle;
  10.  
  11.     self = [super initFrame:frameRect];
  12.  
  13.      if(strcmp([NXApp appName] , "InterfaceBuilder") ==0){
  14.         bundle = [NXBundle bundleForClass:[self class]];
  15.         if ( [bundle getPath:buf forResource:"Timer" ofType:"tiff"] ) {
  16.             image = [[NXImage alloc] initFromFile:buf];
  17.         }
  18.         
  19.     }
  20.         
  21.     return self;
  22. }
  23.  
  24.  
  25. - drawSelf: (const NXRect *)rects :(int)rectCount
  26. {
  27.  
  28.     NXPoint    imagePoint;
  29.     NXRect     imageRect;
  30.  
  31.     NXSetRect(&imageRect,  rects->origin.x,
  32.       rects->origin.y, rects->size.width, 
  33.       rects->size.height);
  34.     imagePoint = imageRect.origin;
  35.     imagePoint.y = 0;
  36.     imagePoint.x = 0;
  37.  
  38.     
  39.     if (image) {
  40.         [image composite:NX_SOVER fromRect:&imageRect toPoint:&imagePoint];
  41.     }
  42.  
  43.     return self;
  44. }
  45.  
  46.  
  47.  
  48. @end
  49.